﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ContactList.aspx.cs" Inherits="AB.ServiceDirectory.Design.HContact.ContactList02" %>

<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="ContentTitle" ContentPlaceHolderID="ContentTitle" runat="server">
    <h2>CONTACT LIST</h2>
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server">
    <asp:UpdatePanel ID="ContactUpdatePanel" runat="server">
        <ContentTemplate>
            <asp:Panel ID="PanelListContacts" runat="server">
                <div class="grid740 simplebox">
                    <asp:Panel ID="SearchPanel" runat="server" DefaultButton="ButtonSearchContact">
                    <div class="st-form-line-noleft">
                        <div class="half">
                            <asp:Label ID="FirstNameLabel" CssClass="st-labeltext" runat="server" Text="First Name"></asp:Label>
                            <asp:TextBox ID="TextBoxFirstName" CssClass="st-forminput" runat="server" Width="200px"></asp:TextBox>
                        </div>
                        <div class="half">
                            <asp:Label ID="LabelName" runat="server" CssClass="st-labeltext" Text="Surname"></asp:Label>
                            <asp:TextBox ID="TextBoxName" runat="server" CssClass="st-forminput" Width="200px"></asp:TextBox>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="button-box">
                        <asp:Button ID="ButtonSearchContact" runat="server" Text="Search" CssClass="st-button"
                            OnClick="ButtonSearchContactClick" />
                        <asp:Button ID="ButtonNone" runat="server" Text="None" CssClass="st-button" 
                            Visible="False" />
                        <asp:Button ID="ButtonClear" runat="server" Text="Clear" CssClass="st-button" OnClick="ButtonClearClick" />
                        <asp:Button ID="ButtonCreate" runat="server" Text="Create" CssClass="st-button" OnClick="ButtonCreateClick" />
                    </div>
                    </asp:Panel>

                    <div class="titleh">
                        <h3>
                            <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active contact ?"
                                AutoPostBack="True" OnCheckedChanged="CheckBoxInactiveCheckedChanged" /></h3>
                    </div>
                    <asp:GridView ID="GridViewContact" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
                        AllowPaging="true" AllowSorting="true" 
                        DataSourceID="ContactObjectDataSource">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <input id="Radio1" type="radio" name="MyRadioButton" value='<%#Eval("ContactId")%>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contact Name" SortExpression="ContactName">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%#String.Format("{0} {1}", Eval("FirstName"), Eval("Surname"))%>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="header" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="MobilePhone" HeaderText="Mobile Phone" SortExpression="MobilePhone">
                                <HeaderStyle CssClass="header"></HeaderStyle>
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Email" SortExpression="Email">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%#Eval("Email")%>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="header" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contact Type" SortExpression="ContactTypeName">
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%#Eval("contacttype.ContactTypeName")%>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="header" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Is Active ?" SortExpression="IsActive">
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%#(bool) Eval("IsActive") ? "Yes" : "No"%>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="header" />
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle CssClass="pagination_table"></PagerStyle>
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ContactObjectDataSource" runat="server" MaximumRowsParameterName="maxRows"
                        TypeName="AB.ServiceDirectory.BO.HungContactBO" SelectCountMethod="GetListCount"
                        EnablePaging="True" SelectMethod="GetList" OnSelecting="ContactObjectDataSourceSelecting"
                        SortParameterName="sortType">
                        <SelectParameters>
                            <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="False" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <br />
                    <div class="">
                        <asp:Button ID="ButtonSelect" runat="server" Text="Select" CssClass="st-button" 
                            Visible="False" />
                        <asp:Button ID="ButtonEdit" runat="server" Text="Edit" CssClass="st-button" OnClick="ButtonEditClick" />
                        <asp:Button ID="ButtonClose" runat="server" Text="Close" CssClass="st-button" 
                            Visible="False" />
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
